﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manager/iShopping-Manager.Master" AutoEventWireup="true" CodeBehind="QuanLyComment.aspx.cs" Inherits="iShopping.Manager.QuanLyComment" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="iShopping" %>
<%@ Import Namespace="iShoppingBUS" %>
<%@ Import Namespace="iShoppingDTO" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
<script language="javascript" type="text/javascript">
// <!CDATA[

function Delete_onclick() {
    var argv = Delete_onclick.arguments;
    var mcm = argv[0];
    var link = "QuanLyComment.aspx";
    var msp = '<%=Session["MaSanPham"]%>';
    var mtk = '<%=Session["MaTaiKhoan"]%>';
    window.location.href=link+"?MSP="+msp+"&MTK="+mtk+"&MCM="+mcm;
}

// ]]>
</script>
    <style type="text/css">
        #Button
        {
            width: 117px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="center_content" style="min-height:250px;">
    <%
        string masanpham = (string)Session["MaSanPham"];
        SanPhamDTO spDTO = SanPhamBUS.LayThongTinTheoMaSanPham(masanpham);
        TaiKhoanDTO tkDTO = TaiKhoanBUS.LayThongTinTaiKhoan(spDTO.MaTaiKhoan);
        List<CommentDTO> listcomment = CommentBUS.GetCommentOfSP(masanpham);
        int ncomment = listcomment.Count;
     %>
    <table width="100%" border="1">
  <tr>
    <td width="34%">
        <div><img src="<%=spDTO.HinhAnh%>" width="350" height="350" /></div>
    </td>
    <td width="66%" valign ="top">
        <div>Thông tin:</div>
        <br />
        <div>   Tên Sản Phẩm: <%=spDTO.TenSanPham%></div>
        <div>   Giá khởi điểm: <%=spDTO.GiaKhoiDiem.ToString()%></div>
        <div>   Thời điểm bắt đầu: <%=spDTO.NgayDang.ToString()%></div>
        <div>   Thời điểm kết thúc: <%=spDTO.NgayHetHan.ToString()%></div>
        <div>   Người đăng: <%=tkDTO.TenTaiKhoan.ToString()%></div>
        <div>   Điểm tin cậy bán: <%=tkDTO.DiemTinCayBan.ToString()%></div>
        <div>   Điểm tin cậy mua: <%=tkDTO.DiemTinCayMua.ToString()%></div>
    </td>
  </tr>
    </table>
    <%
        for (int i = 0; i < ncomment; i++)
        {
    %>
        <div>
            <table width="100%" border="1">
            <table width="100%" border="1">
              <tr>
                <td width="34%">
                    <div><img src="<%=listcomment[i].Avatar%>" width="100" height="100" /></div>
                    
                </td>
                <td width="66%" valign="top">
                    <div>User: <%=listcomment[i].TenTaiKhoan%></div>
                    <div>Viết lúc: <%=listcomment[i].NgayComment%></div>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <table width="100%" border="0">
                       <tr>
                          <td colspan="2">
                                <div><%=listcomment[i].NoiDungComment%></div>
                          </td>
                       </tr>
                       <tr>
                          <td width="79%">&nbsp;</td>
                          <td width="21%">
                              &nbsp;<input id="Button" type="button" value="Xóa Đánh giá này" onclick="return Delete_onclick('<%=listcomment[i].MaCommment.ToString()%>')" />
                          </td>
                       </tr>
                    </table> 
                  </td>
              </tr>
                
            </table>	  
            </table>	             
        </div>
    <%} %>
</div>
<div style="font-size: 18px; font-weight: bold">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <br />
    <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Đánh giá của bạn:
    <br />
    <asp:TextBox ID="TbComment" runat="server" Height="278px" TextMode="MultiLine" 
        Width="95%" style="margin-left: 27px"></asp:TextBox>
     <br />
    <asp:Button ID="BtnComment" runat="server" Text="Đánh giá" 
        style="margin-left: 600px" Width="87px" onclick="BtnComment_Click" />
</div>
</asp:Content>